export const setToken = (token: any) => sessionStorage.setItem('token', token);

export const getToken = () => sessionStorage.getItem('token');

export const removeToken = () => sessionStorage.removeItem('token');

export const serverUrl = 'http://192.168.15.6:3006';

export const dalImg = (url: any) => {
  if (url) {
    if (url.startsWith('http')) {
      return url;
    } else {
      return serverUrl + url;
    }
  }
  return 'https://img1.baidu.com/it/u=1931780999,1969595508&fm=253&fmt=auto&app=138&f=JPEG?w=667&h=500';
};

export const uploadActionUrl = serverUrl + '/common/upload';
